home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_fakeelev.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  106 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_ElevCall.cog
  4. #
  5. # This Cog controls one elevator that can be summoned to any number of floors
  6. # A cog must be placed at each floor to be attached to the call button, the up and down
  7. # buttons, and the elevator.
  8. # You have to manually assign to each cog what floor level it is on.
  9. # Remember that the elevator's first frame is 0 even though your first floor may be one.
  10. #
  11. # [SxC]
  12. #
  13. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  14. # ========================================================================================
  15.  
  16.  
  17. symbols
  18.  
  19.     message     startup
  20.     message     activate
  21.  
  22.     thing       player                              local
  23.     thing        button0                                      
  24.     thing        button1
  25.     thing       swingpos                            nolink                                       
  26.                                                                 
  27.     sound       offbuttonsound=aet_gem_place.wav    local                           
  28.                                            
  29.     int            switch                                local       //check variable for cog internal use
  30.     int         wepnum=1                            local
  31.     int         lastrand=-1                         local
  32.     int         currand=0                           local
  33.     int         screenit=0                          local
  34.                                                     
  35.     sound       indylineb0=inxj058.wav              local
  36.     sound       indylineb1=inxj059.wav              local
  37.     sound       indylineb2=inxj060.wav              local
  38.     sound       indylineb3=inxj061.wav              local
  39.     sound       indylineb4=inxj090.wav              local
  40.     sound       indylineb5=inxj095.wav              local
  41.     
  42. end
  43.  
  44. # ........................................................................................
  45.  
  46. code
  47.  
  48. startup:
  49.  
  50.     player = GetLocalPlayerThing();
  51.     
  52. return;
  53.  
  54. # ........................................................................................
  55.  
  56. activate:
  57.  
  58.     switch = GetSenderRef();
  59.     if (screenit == 1) return;
  60.     
  61.     If (screenit == 0)
  62.     {
  63.         screenit = 1;
  64.         
  65.         StartCutscene(1);
  66.         SetActorFlags(player, 0x200000);
  67.         StopThing(player);
  68.         
  69.         While(wepnum !=0)
  70.         {
  71.             wepnum = GetCurWeapon(player);
  72.             DeselectWeaponWait(player);
  73.             DeselectWeapon(player);
  74.             //printint(wepnum);
  75.         }
  76.         
  77.         SetExtCamOffsetToThing(swingpos);
  78.         PlayMode(player, 60, 0);
  79.         Sleep(0.35);
  80.         PlaySoundThing(offbuttonsound, switch, 1, 10, 20, 0x0080);
  81.         Sleep(0.35);
  82.         
  83.         currand = RandBetween(0, 5);
  84.         While (lastrand == currand)
  85.         {
  86.             currand = RandBetween(0, 5);
  87.         }
  88.         PlayVoice(player, indylineb0[currand], 1, 1);
  89.         lastrand = currand;
  90.         
  91.         EndCutscene();
  92.         RestoreExtCam();
  93.         ClearActorFlags(player, 0x200000);
  94.         
  95.         screenit=0;
  96.         wepnum=1;
  97.     }
  98.     
  99. return;
  100.  
  101. # ........................................................................................
  102.  
  103. end
  104.  
  105.  
  106.